package edu.whu.assignment5.repository;

import edu.whu.assignment5.dataobject.Product;
import edu.whu.assignment5.dataobject.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
public interface ProductRepository extends JpaRepository<Product, Integer> {

    Product findByPid(int pid);

    Product findByPname(String pname);

    @Transactional
    @Modifying
    int deleteByPid(int pid);

}
